<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JS引入预解析</title>
  </head>

  <body>

  </body>
  <script>
    /* 
    引入预解析
     
    */
    //问题一：
    //console.log(num); //Uncaught ReferenceError: num is not defined

    //问题二：
    console.log(age); //undefined
    var age = 20;

    //问题三： 
    fn();

    function fn() {
      console.log(11); //11
    }
    //问题四：
    func(); //Uncaught TypeError: func is not a function

    var func = function () {
      console.log(22);
    }
  </script>

</html>